<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>角色管理</title>
	<%@ include file="/WEB-INF/include/include.jsp" %>
	<script type="text/javascript" src="<%=path %>/js/sysmgr/role/role.js"></script>
  </head>
  <body>
  		<div class="listpage-locked-content">
			<h2 class="listpage-lk-title" >角色管理</h2>
			<div class="listpage-lk-search" id="searchWrap" ></div>
			<div class="listpage-lk-tbar" id="tbarWrap"></div>
		</div>
		
		<div class="listpage-content">
			<div class="listpage-grid" id="gridWrap"></div>
		</div>
		
  </body>
</html>

	<ui:page>

  	<ui:model name="GrildRoleModel">
  		 <x:attr name="fields" type="array">
  			<ui:model.field name="ROLE_ID"   ></ui:model.field>
  			<ui:model.field name="ROLE_NAME"  ></ui:model.field>
  			<ui:model.field name="C_STATUS" defaultValue="1"  ></ui:model.field>
  			<ui:model.field name="C_REMARK"   ></ui:model.field>
  		</x:attr>
  	</ui:model>
	
	<ui:quicksearch handler="RoleList.quickSearch" scope="RoleList" renderTo="searchWrap"></ui:quicksearch>
	<ui:b_toolbar menuCode="menuRole" id="toolbar"  renderTo="tbarWrap" />
	
	<ui:grid id="roleGrid" showCheckbox="true" 
		datasetName="SysRoleDataSetHandler" 
		handlerName="SysRoleLoadHandler" 
		model="GrildRoleModel" renderTo="gridWrap"  >
		<x:columns>
			<ui:gridcolumn dataIndex="ROLE_ID" hidden="true" ></ui:gridcolumn>
			<ui:gridcolumn text="角色名称" dataIndex="ROLE_NAME"/>
			<ui:gridcolumn text="状态" dataIndex="C_STATUS"  renderer="RoleList.statusRender"  />
			<ui:gridcolumn text="备注" dataIndex="C_REMARK"/>
		</x:columns>
	</ui:grid>
	
	
	<ui:searchform id="roleSearchForm">
		<x:items>
			<ui:formPanel.text id="ROLE_NAME" fieldLabel="名称包含" config="true"></ui:formPanel.text>
			<ui:formPanel.text id="C_REMARK" fieldLabel="备注包含" config="true"></ui:formPanel.text>
			<ui:formPanel.comboxstatic id="C_STATUS" fieldLabel="状态" data="[['1','启用'],['0','停用']]" config="true"></ui:formPanel.comboxstatic>
		</x:items>
	</ui:searchform>
	<ui:advSearchWindow searchFormId="roleSearchForm" id="advSearchWin" 
	searchHandlerscope="RoleList" searchHandler="RoleList.advSearch" 
	height="200" width="300"/>



	<ui:tree id="menuTreeNotInRole" var="menuTreeNotInRole"  width="200" title="未授权菜单"
		handlerMethod="queryMenuTreeNotInRole" 
		datasetName="MenuDataSetHandler" 
		handlerName="MenuQueryHandler" >
		<x:attr name="region">west</x:attr>
		<x:attr name="border">false</x:attr>
	</ui:tree>
	
	<ui:tree id="menuTreeInRole" var="menuTreeInRole" width="200" title="已授权菜单"
		handlerMethod="queryMenuTreeInRole"  
		datasetName="MenuDataSetHandler" 
		handlerName="MenuQueryHandler">
		<x:attr name="region">east</x:attr>
		<x:attr name="border">false</x:attr>
	</ui:tree>
	
	
			
	
	
	<ui:panel id="assignPannel" var="assignPannel" width="100">
		<x:attr name="region">center</x:attr>
		<x:attr name="border">false</x:attr>
		<x:attr name="bodyStyle">padding-top:100px;</x:attr>
		<x:items>
			<ui:button text="添加  >>" id="assignBtn" handler="RoleList.assignMenu" >
			</ui:button>
			<ui:button text="<< 移除" id="cancelBtn"  handler="RoleList.canclAssignMenu">
			</ui:button>					
		</x:items>
	</ui:panel>
	
	<ui:window  id="roleMenuWin"  width="500" height="400" title="角色授权">
		<x:attr name="layout" type="string">border</x:attr>
		<x:attr name="closeAction">hide</x:attr>
		<x:items>
			<x:value type="direct">menuTreeNotInRole</x:value>
			<x:value type="direct">assignPannel</x:value>
			<x:value type="direct">menuTreeInRole</x:value>
		</x:items>
		<x:attr name="buttons">
			<x:array>
				<ui:button text="保存"  id="saveRoleBtn" handler="RoleList.saveRoleMenu" />
				<ui:button text="取消" handler="RoleList.cancleSaveRoleMenu"/>
			</x:array>
		</x:attr>
	</ui:window>
	
	</ui:page>

	
